$(function () {

    $("body").on('click',"#articleType-list>li",function () {
        var _this = $(this);
        _this.addClass('active').siblings('#articleType-list>li').removeClass('active');
        queryArticleListData(1);
    });
    queryArticleListData(1);

    /**
     * 加载课程图片
     */
    function lazyCourseImage() {
        //图片数据懒加载
        $('img.lazy').lazyload({
            placeholder: staticPath+'/static/front/web/v3/img/default/default-course.gif',  //占位图
            effect: 'fadeIn' //载入方式
        });
    }

    //获取咨询数据列表
    function queryArticleListData(pageNo) {
        var typeId = $($("#articleType-list").find(".active")[0]).data("id");
        var _params = {"typeId":typeId};
        _params = JSON.stringify(_params);
        getPageAjaxData({
            url: baseloaction + '/web/article/ajax/articleList',
            contextId:'article-list-context',
            pageNo:pageNo,
            pageCall:queryArticleListData,
            params:_params,
            callback:function (pageNo) {
                lazyCourseImage();
            }
        });
    }
});